package com.zmx;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @ClassName: test
 * @Author zhaomxr
 * @Date 2022-01-04 13:54
 */
public class test {

    public static void main(String[] args) {
        //String alterTable = "ALTER TABLE %s DROP COLUMN creator;,ALTER TABLE %s DROP COLUMN create_time;,ALTER TABLE %s DROP COLUMN modifier;,ALTER TABLE %s DROP COLUMN modify_time;,ALTER TABLE %s DROP COLUMN create_date;,ALTER TABLE %s DROP COLUMN modify_date;,ALTER TABLE `%s` ADD COLUMN `creator` varchar(255) NULL;,ALTER TABLE `%s` ADD COLUMN `create_time` datetime NULL AFTER `creator`;,ALTER TABLE `%s` ADD COLUMN `modifier` varchar(255) NULL AFTER `create_time`;,ALTER TABLE `%s` ADD COLUMN `modify_time` datetime NULL AFTER `modifier`;,ALTER TABLE `%s` ADD COLUMN `ts` datetime NULL AFTER `modify_time`;";
        //String tableStr = "alipay_config,b2c_order,b2c_ordercancel,b2c_order_item,b2c_order_log,base_community,base_community_dept_relation,base_community_product_relation,base_dept,base_dict,base_dict_detail,base_email_config,base_hibernate_sequence,base_job,base_member_community_relation,base_service_phone,generator_gen_config,member,member_cart,member_comments,member_receiver,member_record_login,oauth_client_details,payment,payment_log,payment_refundcancel,payment_refunds,payment_refund_single,payment_refund_single_logs,payment_refund_sing_items,product,product_brand,product_category,product_supplier,promote_active,promote_active_product_relation,request_log_2021_01_04,sys_log,sys_menu,sys_permission,sys_picture,sys_qiniu_config,sys_qiniu_content,sys_quartz_job,sys_quartz_log,sys_role,sys_roles_depts,sys_roles_menus,sys_roles_permissions,sys_user,sys_users_roles,sys_verification_code,sys_visits";
        //for(String table:tableStr.split(",")){
        //    for(String alert:alterTable.split(",")){
        //        System.out.println(String.format(alert, table));
        //    }
        //}

        String alterTable = "ALTER TABLE %s DROP COLUMN dr;,ALTER TABLE `%s` ADD COLUMN `dr` int(3) NULL COMMENT '是否已删除（0-否 1-是）' AFTER `ts`;";
        String tableStr = "alipay_config,b2c_order,b2c_ordercancel,b2c_order_item,b2c_order_log,base_community,base_community_dept_relation,base_community_product_relation,base_dept,base_dict,base_dict_detail,base_email_config,base_hibernate_sequence,base_job,base_member_community_relation,base_service_phone,generator_gen_config,member,member_cart,member_comments,member_receiver,member_record_login,oauth_client_details,payment,payment_log,payment_refundcancel,payment_refunds,payment_refund_single,payment_refund_single_logs,payment_refund_sing_items,product,product_brand,product_category,product_supplier,promote_active,promote_active_product_relation,request_log_2021_01_04,sys_log,sys_menu,sys_permission,sys_picture,sys_qiniu_config,sys_qiniu_content,sys_quartz_job,sys_quartz_log,sys_role,sys_roles_depts,sys_roles_menus,sys_roles_permissions,sys_user,sys_users_roles,sys_verification_code,sys_visits";
        for(String table:tableStr.split(",")){
            for(String alert:alterTable.split(",")){
                System.out.println(String.format(alert, table));
            }
        }
    }
}
